<!DOCTYPE html>
<html lang="zh-Hans">
  <head>
    
<meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>


<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />

<meta name="theme-color" content="#f8f5ec" />
<meta name="msapplication-navbutton-color" content="#f8f5ec">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="#f8f5ec">



  <meta name="description" content="Ubuntu上个人常用软件的安装方法"/>




  <meta name="keywords" content="技术, 工具, Linux, 杂鱼君的博客" />










  <link rel="alternate" href="/atom.xml" title="杂鱼君的博客">




  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=2.6.0" />



<link rel="canonical" href="http://notes.wen.moe/post/install-my-common-software-on-ubuntu.html"/>


<link rel="stylesheet" type="text/css" href="/css/style.css?v=2.6.0" />



  <link rel="stylesheet" type="text/css" href="/lib/fancybox/jquery.fancybox.css" />




  



  <script id="baidu_push">
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>









    <title> Ubuntu上个人常用软件的安装方法 - 杂鱼君的博客 </title>
  </head>

  <body><div id="mobile-navbar" class="mobile-navbar">
  <div class="mobile-header-logo">
    <a href="/." class="logo">杂鱼君的博客</a>
  </div>
  <div class="mobile-navbar-icon">
    <span></span>
    <span></span>
    <span></span>
  </div>
</div>

<nav id="mobile-menu" class="mobile-menu slideout-menu">
  <ul class="mobile-menu-list">
    
      <a href="/">
        <li class="mobile-menu-item">
          
          
            Home
          
        </li>
      </a>
    
      <a href="/archives/">
        <li class="mobile-menu-item">
          
          
            Archives
          
        </li>
      </a>
    
      <a href="/tags">
        <li class="mobile-menu-item">
          
          
            Tags
          
        </li>
      </a>
    
      <a href="/about">
        <li class="mobile-menu-item">
          
          
            About
          
        </li>
      </a>
    
  </ul>
</nav>

    <div class="container" id="mobile-panel">
      <header id="header" class="header"><div class="logo-wrapper">
  <a href="/." class="logo">杂鱼君的博客</a>
</div>

<nav class="site-navbar">
  
    <ul id="menu" class="menu">
      
        <li class="menu-item">
          <a class="menu-item-link" href="/">
            
            
              Home
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/archives/">
            
            
              Archives
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/tags">
            
            
              Tags
            
          </a>
        </li>
      
        <li class="menu-item">
          <a class="menu-item-link" href="/about">
            
            
              About
            
          </a>
        </li>
      
    </ul>
  
</nav>

      </header>

      <main id="main" class="main">
        <div class="content-wrapper">
          <div id="content" class="content">
            
  
  <article class="post">
    <header class="post-header">
      <h1 class="post-title">
        
          Ubuntu上个人常用软件的安装方法
        
      </h1>

      <div class="post-meta">
        <span class="post-time">
          2015-04-12
        </span>
        
          <div class="post-category">
            
              <a href="/categories/技术/">技术</a>
            
          </div>
        
        
      </div>
    </header>

    
    
  <div class="post-toc" id="post-toc">
    <h2 class="post-toc-title">Contents</h2>
    <div class="post-toc-content">
      <ol class="toc"><li class="toc-item toc-level-2"><a class="toc-link" href="#chrome"><span class="toc-text">chrome</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#dropbox"><span class="toc-text">dropbox</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#oh-my-zsh"><span class="toc-text">oh-my-zsh</span></a></li><li class="toc-item toc-level-2"><a class="toc-link" href="#sublime-text"><span class="toc-text">sublime text</span></a></li></ol>
    </div>
  </div>


    <div class="post-content">
      
        <p><em>以下软件有些需要翻墙，具体怎么做就不说了</em></p>
<p>对于程序员来说，Ubuntu比Windows更适合作为日常使用的操作系统(好用个P,OSX赛高!)，当然前<br>提是不喜欢玩游戏。安装系统非常简单，但是一些在windows上常用的软件安装起来还真费了些事，就把他记录在这里把。</p>
<a id="more"></a>
<h2 id="chrome"><a href="#chrome" class="headerlink" title="chrome"></a>chrome</h2><p>首先是上网的入口——浏览器。很遗憾这么重要的软件居然在ubuntu的软件中心找不到，我们<br>只能去chrome浏览器的<a href="http://chrome.google.com" target="_blank" rel="external">主页</a> 去手动下载，谷歌会分析我们的操作系统，推荐对应的软件包。<br>本来这是一件及其简单的事情，但是由于GFW的存在……自己找代理去吧。</p>
<h2 id="dropbox"><a href="#dropbox" class="headerlink" title="dropbox"></a>dropbox</h2><p>个人最喜欢用的网盘，依然悲剧的被阻挡在了墙外。首先去<a href="https://www.dropbox.com/install?os=lnx" target="_blank" rel="external">官网</a>下载deb包，<br>安装以后dropbox会启动自己的下载器去下载完整的dropbox资源。这里坑出现了，大部分情况下是无法连接服务器的，即使<br>开了代理也不行。这时候我们可以通过：</p>
<figure class="highlight nginx"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attribute">cd</span> <span class="regexp">~ &amp;&amp;</span> wget -O - <span class="string">"https://www.dropbox.com/download?plat=lnx.x86_64"</span> | tar xzf -</div></pre></td></tr></table></figure>
<p>或者浏览器直接打开：<br><figure class="highlight routeros"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">www.dropbox.com/download?<span class="attribute">plat</span>=lnx.x86_64</div></pre></td></tr></table></figure></p>
<p>这种方法下载dropbox的离线包，解压出 <code>  .dropbox_dist </code> 文件夹 ，放在主目录，重启dropbox软件就可以正常运行了。</p>
<h2 id="oh-my-zsh"><a href="#oh-my-zsh" class="headerlink" title="oh-my-zsh"></a>oh-my-zsh</h2><figure class="highlight awk"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">apt-get install zsh</div><div class="line">wget https:<span class="regexp">//gi</span>thub.com<span class="regexp">/robbyrussell/</span>oh-my-zsh<span class="regexp">/raw/m</span>aster<span class="regexp">/tools/i</span>nstall.sh -O - | zsh</div><div class="line">chsh -s `which zsh`  <span class="regexp">//</span>这里需要输入root密码</div></pre></td></tr></table></figure>
<p>重启系统就OK了。</p>
<h2 id="sublime-text"><a href="#sublime-text" class="headerlink" title="sublime text"></a>sublime text</h2><p>ST 可以直接在官网<a href="http://www.sublimetext.com/" target="_blank" rel="external">下载</a>，然后直接安装。悲剧的是ST在Linux下有个不能输入中文的bug，在网上google<br>个遍，找到个相对完美的解决办法：</p>
<ol>
<li>创建一个<code>sublime-imfix.c</code>文件，写入如下代码：</li>
</ol>
<figure class="highlight c"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div><div class="line">15</div><div class="line">16</div><div class="line">17</div><div class="line">18</div><div class="line">19</div><div class="line">20</div><div class="line">21</div><div class="line">22</div><div class="line">23</div><div class="line">24</div><div class="line">25</div><div class="line">26</div><div class="line">27</div><div class="line">28</div><div class="line">29</div><div class="line">30</div><div class="line">31</div><div class="line">32</div><div class="line">33</div><div class="line">34</div><div class="line">35</div><div class="line">36</div><div class="line">37</div><div class="line">38</div><div class="line">39</div><div class="line">40</div><div class="line">41</div><div class="line">42</div><div class="line">43</div><div class="line">44</div><div class="line">45</div><div class="line">46</div><div class="line">47</div><div class="line">48</div><div class="line">49</div><div class="line">50</div><div class="line">51</div><div class="line">52</div><div class="line">53</div><div class="line">54</div><div class="line">55</div><div class="line">56</div><div class="line">57</div><div class="line">58</div><div class="line">59</div><div class="line">60</div><div class="line">61</div><div class="line">62</div><div class="line">63</div><div class="line">64</div><div class="line">65</div><div class="line">66</div><div class="line">67</div><div class="line">68</div><div class="line">69</div><div class="line">70</div><div class="line">71</div><div class="line">72</div><div class="line">73</div><div class="line">74</div><div class="line">75</div><div class="line">76</div><div class="line">77</div><div class="line">78</div><div class="line">79</div></pre></td><td class="code"><pre><div class="line"><span class="comment">/*</span></div><div class="line"><span class="comment">sublime-imfix.c</span></div><div class="line"><span class="comment">Use LD_PRELOAD to interpose some function to fix sublime input method support for linux.</span></div><div class="line"><span class="comment">By Cjacker Huang</span></div><div class="line"><span class="comment"></span></div><div class="line"><span class="comment">gcc -shared -o libsublime-imfix.so sublime-imfix.c `pkg-config --libs --cflags gtk+-2.0` -fPIC</span></div><div class="line"><span class="comment">LD_PRELOAD=./libsublime-imfix.so subl</span></div><div class="line"><span class="comment">*/</span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;gtk/gtk.h&gt;</span></span></div><div class="line"><span class="meta">#<span class="meta-keyword">include</span> <span class="meta-string">&lt;gdk/gdkx.h&gt;</span></span></div><div class="line"><span class="keyword">typedef</span> GdkSegment GdkRegionBox;</div><div class="line"></div><div class="line"><span class="class"><span class="keyword">struct</span> _<span class="title">GdkRegion</span></span></div><div class="line"><span class="class">&#123;</span></div><div class="line">  <span class="keyword">long</span> size;</div><div class="line">  <span class="keyword">long</span> numRects;</div><div class="line">  GdkRegionBox *rects;</div><div class="line">  GdkRegionBox extents;</div><div class="line">&#125;;</div><div class="line"></div><div class="line">GtkIMContext *local_context;</div><div class="line"></div><div class="line"><span class="keyword">void</span></div><div class="line">gdk_region_get_clipbox (<span class="keyword">const</span> GdkRegion *region,</div><div class="line">            GdkRectangle    *rectangle)</div><div class="line">&#123;</div><div class="line">  g_return_if_fail (region != <span class="literal">NULL</span>);</div><div class="line">  g_return_if_fail (rectangle != <span class="literal">NULL</span>);</div><div class="line"></div><div class="line">  rectangle-&gt;x = region-&gt;extents.x1;</div><div class="line">  rectangle-&gt;y = region-&gt;extents.y1;</div><div class="line">  rectangle-&gt;width = region-&gt;extents.x2 - region-&gt;extents.x1;</div><div class="line">  rectangle-&gt;height = region-&gt;extents.y2 - region-&gt;extents.y1;</div><div class="line">  GdkRectangle rect;</div><div class="line">  rect.x = rectangle-&gt;x;</div><div class="line">  rect.y = rectangle-&gt;y;</div><div class="line">  rect.width = <span class="number">0</span>;</div><div class="line">  rect.height = rectangle-&gt;height;</div><div class="line">  <span class="comment">//The caret width is 2;</span></div><div class="line">  <span class="comment">//Maybe sometimes we will make a mistake, but for most of the time, it should be the caret.</span></div><div class="line">  <span class="keyword">if</span>(rectangle-&gt;width == <span class="number">2</span> &amp;&amp; GTK_IS_IM_CONTEXT(local_context)) &#123;</div><div class="line">        gtk_im_context_set_cursor_location(local_context, rectangle);</div><div class="line">  &#125;</div><div class="line">&#125;</div><div class="line"></div><div class="line"><span class="comment">//this is needed, for example, if you input something in file dialog and return back the edit area</span></div><div class="line"><span class="comment">//context will lost, so here we set it again.</span></div><div class="line"></div><div class="line"><span class="function"><span class="keyword">static</span> GdkFilterReturn <span class="title">event_filter</span> <span class="params">(GdkXEvent *xevent, GdkEvent *event, gpointer im_context)</span></span></div><div class="line"><span class="function"></span>&#123;</div><div class="line">    XEvent *xev = (XEvent *)xevent;</div><div class="line">    <span class="keyword">if</span>(xev-&gt;type == KeyRelease &amp;&amp; GTK_IS_IM_CONTEXT(im_context)) &#123;</div><div class="line">       GdkWindow * win = g_object_get_data(G_OBJECT(im_context),<span class="string">"window"</span>);</div><div class="line">       <span class="keyword">if</span>(GDK_IS_WINDOW(win))</div><div class="line">         gtk_im_context_set_client_window(im_context, win);</div><div class="line">    &#125;</div><div class="line">    <span class="keyword">return</span> GDK_FILTER_CONTINUE;</div><div class="line">&#125;</div><div class="line"></div><div class="line"><span class="function"><span class="keyword">void</span> <span class="title">gtk_im_context_set_client_window</span> <span class="params">(GtkIMContext *context,</span></span></div><div class="line"><span class="function"><span class="params">          GdkWindow    *window)</span></span></div><div class="line"><span class="function"></span>&#123;</div><div class="line">  GtkIMContextClass *klass;</div><div class="line">  g_return_if_fail (GTK_IS_IM_CONTEXT (context));</div><div class="line">  klass = GTK_IM_CONTEXT_GET_CLASS (context);</div><div class="line">  <span class="keyword">if</span> (klass-&gt;set_client_window)</div><div class="line">    klass-&gt;set_client_window (context, window);</div><div class="line"></div><div class="line">  <span class="keyword">if</span>(!GDK_IS_WINDOW (window))</div><div class="line">    <span class="keyword">return</span>;</div><div class="line">  g_object_set_data(G_OBJECT(context),<span class="string">"window"</span>,window);</div><div class="line">  <span class="keyword">int</span> width = gdk_window_get_width(window);</div><div class="line">  <span class="keyword">int</span> height = gdk_window_get_height(window);</div><div class="line">  <span class="keyword">if</span>(width != <span class="number">0</span> &amp;&amp; height !=<span class="number">0</span>) &#123;</div><div class="line">    gtk_im_context_focus_in(context);</div><div class="line">    local_context = context;</div><div class="line">  &#125;</div><div class="line">  gdk_window_add_filter (window, event_filter, context);</div><div class="line">&#125;</div></pre></td></tr></table></figure>
<ol>
<li>安装相关的依赖：</li>
</ol>
<figure class="highlight armasm"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="symbol">sudo</span> apt-<span class="meta">get</span> install <span class="keyword">build-essential </span>libgtk2.<span class="number">0</span>-dev</div></pre></td></tr></table></figure>
<ol>
<li>编译文件并且移动</li>
</ol>
<figure class="highlight stylus"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">gcc -shared -o libsublime-imfix<span class="selector-class">.so</span> sublime-imfix<span class="selector-class">.c</span>  `pkg-config --libs --cflags gtk+-<span class="number">2.0</span>` -fPIC</div><div class="line"></div><div class="line">sudo cp libsublime-imfix<span class="selector-class">.so</span> /opt/sublime_text/</div></pre></td></tr></table></figure>
<ol>
<li>输入法的安装</li>
</ol>
<p>根据<a href="http://pinyin.sogou.com/linux/help.php" target="_blank" rel="external">这个方法</a>安装搜狗输入法,然后就可以通过这个命令：</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attr">LD_PRELOAD</span>=./libsublime-imfix.so subl</div></pre></td></tr></table></figure>
<p>正常的话就可以输入中文了。</p>
<ol>
<li>快捷方式的修改：</li>
</ol>
<p>前面的方法只能让我们在命令行打开ST的状况下才能输入中文，如果想通过dock栏的ST图标打开也能输入中文的的话，需要这么做:</p>
<figure class="highlight crystal"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">sudo cp libsublime-imfix.so /usr/<span class="class"><span class="keyword">lib</span>/</span></div><div class="line"></div><div class="line">vim /usr/share/applications/sublime_text.desktop</div></pre></td></tr></table></figure>
<p>修改这个文件,将:</p>
<figure class="highlight armasm"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="symbol">Exec</span>=/<span class="meta">opt</span>/<span class="keyword">sublime_text/sublime_text </span>%F</div></pre></td></tr></table></figure>
<p>修改为:</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attr">Exec</span>=bash -c <span class="string">'LD_PRELOAD=/usr/lib/libsublime-imfix.so /opt/sublime_text/sublime_text'</span> %F</div></pre></td></tr></table></figure>
<p>还有这一行:</p>
<figure class="highlight armasm"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="symbol">Exec</span>=/<span class="meta">opt</span>/<span class="keyword">sublime_text/sublime_text </span>-n</div></pre></td></tr></table></figure>
<p>修改为</p>
<figure class="highlight ini"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line"><span class="attr">Exec</span>=bash -c <span class="string">'LD_PRELOAD=/usr/lib/libsublime-imfix.so /opt/sublime_text/sublime_text'</span> -n</div></pre></td></tr></table></figure>
<p>这样的话通过快捷方式打开的ST也能输入中文了。<br>最后，这种方法会导致一个bug，就是在文件上点击右键-&gt;通过sublime text 打开的话，只会打开软件，文件是无法打开的。不过并不影响使用啦。</p>
<p>sublime text的插件以及设置都很值得研究，我也写了个博文，具体看<a href="http://wen.moe/sublime-plugin-introduce" target="_blank" rel="external">这里</a>。</p>

      
    </div>

    
      
      

  <div class="post-copyright">
    <p class="copyright-item">
      <span>Author: </span>
      <a href="http://notes.wen.moe">zakokun</a>
    </p>
    <p class="copyright-item">
      <span>Link: </span>
      <a href="http://notes.wen.moe/post/install-my-common-software-on-ubuntu.html">http://notes.wen.moe/post/install-my-common-software-on-ubuntu.html</a>
    </p>
    <p class="copyright-item">
      <span>License: </span>
      
      <a rel="license" href="http://creativecommons.org/licenses/by-nc/4.0/" target="_blank">知识共享署名-非商业性使用 4.0 国际许可协议</a>
    </p>
  </div>



      
      
    

    
      <footer class="post-footer">
        
          <div class="post-tags">
            
              <a href="/tags/技术/">技术</a>
            
              <a href="/tags/工具/">工具</a>
            
              <a href="/tags/Linux/">Linux</a>
            
          </div>
        
        
        
  <nav class="post-nav">
    
      <a class="prev" href="/post/install-jekyll-on-elementary-os.html">
        <i class="iconfont icon-left"></i>
        <span class="prev-text nav-default">在elementary OS/ubuntu安装jekyll</span>
        <span class="prev-text nav-mobile">Prev</span>
      </a>
    
    
      <a class="next" href="/post/learn-design-patterns-observer.html">
        <span class="next-text nav-default">设计模式的学习--观察者模式</span>
        <span class="prev-text nav-mobile">Next</span>
        <i class="iconfont icon-right"></i>
      </a>
    
  </nav>

      </footer>
    

  </article>


          </div>
          
  <div class="comments" id="comments">
    
      <div id="disqus_thread">
        <noscript>
          Please enable JavaScript to view the
          <a href="//disqus.com/?ref_noscript">comments powered by Disqus.</a>
        </noscript>
      </div>
    
  </div>


        </div>
      </main>

      <footer id="footer" class="footer">

  <div class="social-links">
    
      
        
          <a href="mailto:me@wen.moe" class="iconfont icon-email" title="email"></a>
        
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
    
      
        
          <a href="https://www.instagram.com/zakokun" class="iconfont icon-instagram" title="instagram"></a>
        
      
    
    
    
  </div>


<div class="copyright">
  <span class="power-by">
    Powered by <a class="hexo-link" href="https://hexo.io/">Hexo</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Theme -
    <a class="theme-link" href="https://github.com/ahonn/hexo-theme-even">Even</a>
  </span>
  <span class="division">|</span>
  <span class="theme-info">
    Hosted by <a class="theme-link" href="https://pages.coding.me" style="font-weight: bold">Coding Pages</a>
  </span>

  <span class="copyright-year">
    
    &copy;
    
      2014 -
    
    2017

    <span class="heart">
      <i class="iconfont icon-heart"></i>
    </span>
    <span class="author">zakokun</span>
  </span>
</div>

      </footer>

      <div class="back-to-top" id="back-to-top">
        <i class="iconfont icon-up"></i>
      </div>
    </div>

    
  
  <script type="text/javascript">
    var disqus_config = function () {
        this.page.url = 'http://notes.wen.moe/post/install-my-common-software-on-ubuntu.html';
        this.page.identifier = 'post/install-my-common-software-on-ubuntu.html';
        this.page.title = 'Ubuntu上个人常用软件的安装方法';
    };
    (function() {
    var d = document, s = d.createElement('script');

    s.src = '//evanszhang.disqus.com/embed.js';

    s.setAttribute('data-timestamp', +new Date());
    (d.head || d.body).appendChild(s);
    })();  
  </script>




    
  





  
    <script type="text/javascript" src="/lib/jquery/jquery-3.1.1.min.js"></script>
  

  
    <script type="text/javascript" src="/lib/slideout/slideout.js"></script>
  

  
    <script type="text/javascript" src="/lib/fancybox/jquery.fancybox.pack.js"></script>
  


    <script type="text/javascript" src="/js/src/even.js?v=2.6.0"></script>
<script type="text/javascript" src="/js/src/bootstrap.js?v=2.6.0"></script>

  </body>
</html>
